<template>
    <div>
        <el-form label-position="left" label-width="100px" v-model="legend">
            <el-form-item label="显示">
              <el-radio v-model="legend.show" :label="true">是</el-radio>
              <el-radio v-model="legend.show" :label="false">否</el-radio>
            </el-form-item>
            <el-form-item label="距左侧">
              <el-input v-model="legend.left" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="距右侧">
              <el-input v-model="legend.right" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="距顶部">
              <el-input v-model="legend.top" size="mini"></el-input>
            </el-form-item>
            <el-form-item label="距底部">
              <el-input v-model="legend.bottom" size="mini"></el-input>
            </el-form-item>
            <el-divider content-position="center">图标</el-divider>
            <el-form-item  label="宽度">
                <el-input-number v-model="legend.itemWidth" :min="0" :max="50" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="高度">
                <el-input-number v-model="legend.itemHeight" :min="0" :max="50" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="间隔">
                <el-input-number v-model="legend.itemGap" :min="0" :max="50" size="mini"></el-input-number>
            </el-form-item>
            <el-divider content-position="center">文字</el-divider>
            <el-form-item  label="字体">
               <el-select v-model="legend.textStyle.fontFamily" placeholder="sans-serif" size="mini">
                <el-option label="sans-serif" value="sans-serif"/>
                <el-option label="monospace" value="monospace"/>
                <el-option label="Courier New" value="Courier New"/>
                <el-option label="Microsoft YaHei" value="Microsoft YaHei"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="字号">
                <el-input-number v-model="legend.textStyle.fontSize" :min="0" :max="50" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item  label="粗细">
              <el-select v-model="legend.textStyle.fontWeight" placeholder="normal" size="mini">
                <el-option label="normal" value="normal"/>
                <el-option label="bold" value="bold"/>
                <el-option label="bolder" value="bolder"/>
                <el-option label="lighter" value="lighter"/>
              </el-select>
            </el-form-item>
            <el-form-item  label="行高">
                <el-input-number v-model="legend.textStyle.lineHeight" :min="0" :max="100" size="mini"></el-input-number>
            </el-form-item>
            <el-form-item label="颜色">
              <el-color-picker v-model="legend.textStyle.color" show-alpha size="small" @active-change="color"></el-color-picker>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>

export default {
  data: function () {
    return {
    }
  },
  methods: {
    color (val) {
      this.legend.textStyle.color = val
    },
    backgroundColor (val) {
      this.legend.textStyle.backgroundColor = val
    },
    borderColor (val) {
      this.legend.textStyle.borderColor = val
    },
    shadowColor (val) {
      this.legend.textStyle.shadowColor = val
    }

  },
  computed: {
    legend () {
      return this.$store.state.layout[this.$store.state.activeArrayIndex].SlideContent[this.$store.state.insideActiveArrayIndex].itemContent.detail.legend
    }
  },
  watch: {
  },
  components: {
  }
}
</script>

<style scoped>
    .el-form-item {
        margin-bottom: 0px
    }
</style>
